<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>gitee+hexo搭建个人博客 | dmf的个人博客</title><meta name="author" content="dmf"><meta name="copyright" content="dmf"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="描述">
<meta property="og:type" content="article">
<meta property="og:title" content="gitee+hexo搭建个人博客">
<meta property="og:url" content="https://gitee.com/dmf-c/blog/2021/11/28/MyBlog/index.html">
<meta property="og:site_name" content="dmf的个人博客">
<meta property="og:description" content="描述">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img1.baidu.com/it/u=3691791879,443411760&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=889">
<meta property="article:published_time" content="2021-11-27T16:00:00.000Z">
<meta property="article:modified_time" content="2023-01-30T06:05:33.243Z">
<meta property="article:author" content="dmf">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://img1.baidu.com/it/u=3691791879,443411760&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=889"><link rel="shortcut icon" href="/blog/img/favicon.png"><link rel="canonical" href="https://gitee.com/dmf-c/blog/2021/11/28/MyBlog/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/blog/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/blog/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'gitee+hexo搭建个人博客',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-01-30 14:05:33'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/blog/archives/"><div class="headline">文章</div><div class="length-num">27</div></a><a href="/blog/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/blog/categories/"><div class="headline">分类</div><div class="length-num">6</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/blog/"><i class="fa-fw iconfont icon-shouyex"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw iconfont icon-zuixinwenzhang_huaban"></i><span> 找文章</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/blog/categories/"><i class="fa-fw iconfont icon-fenlei1"></i><span> 分类</span></a></li><li><a class="site-page child" href="/blog/tags/"><i class="fa-fw iconfont icon-biaoqian1"></i><span> 标签</span></a></li><li><a class="site-page child" href="/blog/archives/"><i class="fa-fw iconfont icon-shijianzhou"></i><span> 归档</span></a></li></ul></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://img1.baidu.com/it/u=3691791879,443411760&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=500&amp;h=889')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/blog/">dmf的个人博客</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/blog/"><i class="fa-fw iconfont icon-shouyex"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw iconfont icon-zuixinwenzhang_huaban"></i><span> 找文章</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/blog/categories/"><i class="fa-fw iconfont icon-fenlei1"></i><span> 分类</span></a></li><li><a class="site-page child" href="/blog/tags/"><i class="fa-fw iconfont icon-biaoqian1"></i><span> 标签</span></a></li><li><a class="site-page child" href="/blog/archives/"><i class="fa-fw iconfont icon-shijianzhou"></i><span> 归档</span></a></li></ul></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">gitee+hexo搭建个人博客</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="fa-fw post-meta-icon far fa-calendar-alt"></i><span class="post-meta-label">发表于</span><time datetime="2021-11-27T16:00:00.000Z" title="发表于 2021-11-28 00:00:00">2021-11-28</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/blog/categories/%E5%B7%A5%E5%85%B7%E7%B1%BB/">工具类</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="gitee+hexo搭建个人博客"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><p><a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/">Hexo</a>是一款基于 Node.js 的静态博客框架，依赖少易于安装使用，是搭建博客的首选框架。</p>
<h2 id="前期准备"><a href="#前期准备" class="headerlink" title="前期准备"></a>前期准备</h2><p>环境要求<br><a target="_blank" rel="noopener" href="https://git-scm.com/download">Git</a> &#x2F; <a target="_blank" rel="noopener" href="https://registry.npmmirror.com/binary.html?path=git-for-windows/">淘宝镜像</a></p>
<p><a target="_blank" rel="noopener" href="https://nodejs.org/zh-cn/">Node.js</a> Markdown Preview Enhanced</p>
<h2 id="开始搭建"><a href="#开始搭建" class="headerlink" title="开始搭建"></a>开始搭建</h2><h3 id="新建项目"><a href="#新建项目" class="headerlink" title="新建项目"></a>新建项目</h3><p>新建一个 MyBlog 文件夹用来存放所有博客的 markdown 文件以及 html 文件。</p>
<h3 id="安装-hexo"><a href="#安装-hexo" class="headerlink" title="安装 hexo"></a>安装 hexo</h3><p>进入 MyBlog 文件夹右键 Git Bash Here</p>
<img src="https://s1.ax1x.com/2022/09/07/vHlbGT.png">

<p>输入命令 npm install hexo-cli -g</p>
<p>随后输入 hexo init 初始化 hexo 模板</p>
<img src="https://s1.ax1x.com/2022/09/07/vH13Qg.png">

<p>生成的模板文件如下图</p>
<img src="https://s1.ax1x.com/2022/09/07/vH1aF0.png">

<h3 id="运行-hexo"><a href="#运行-hexo" class="headerlink" title="运行 hexo"></a>运行 hexo</h3><blockquote>
<p>在 MyBlog 文件夹下运行运行 hexo ,下面是一些常用的 hexo 指令：</p>
</blockquote>
<blockquote>
<p>（1）hexo g 该命令执行后在根目录下生成 public 文件夹</p>
</blockquote>
<blockquote>
<p>（2）hexo clean 把（1）中的 public 文件夹删除</p>
</blockquote>
<blockquote>
<p>（3）hexo s 启动服务，默认地址为 <a target="_blank" rel="noopener" href="http://localhost:4000/">http://localhost:4000/</a></p>
</blockquote>
<p>通过 Ctrl + C 来停止本地服务器</p>
<p>在浏览器上输入 <a target="_blank" rel="noopener" href="http://localhost:4000/">http://localhost:4000</a> 就能查看演示样式 helloworld 页面：</p>
<img src="https://s1.ax1x.com/2022/09/07/vH1vp8.png">

<img src="https://s1.ax1x.com/2022/09/07/vH1z6g.png">

<h2 id="主题美化"><a href="#主题美化" class="headerlink" title="主题美化"></a>主题美化</h2><h3 id="选择主题"><a href="#选择主题" class="headerlink" title="选择主题"></a>选择主题</h3><p>官网：<a target="_blank" rel="noopener" href="https://hexo.io/themes/">https://hexo.io/themes/</a></p>
<p>gitee：<a target="_blank" rel="noopener" href="https://search.gitee.com/?q=hexo+theme">https://search.gitee.com/?q=hexo+theme</a></p>
<p>本文使用：<a href="https://gitee.com/immyw/hexo-theme-butterfly">https://gitee.com/immyw/hexo-theme-butterfly</a></p>
<h3 id="主题下载"><a href="#主题下载" class="headerlink" title="主题下载"></a>主题下载</h3><p>通过代码 git clone -b master <a href="https://gitee.com/immyw/hexo-theme-butterfly.git">https://gitee.com/immyw/hexo-theme-butterfly.git</a> themes&#x2F;butterfly 来下载 butterfly 主题。</p>
<p>代码运行完成后会在 themes 文件夹直接生成对应的主题文件夹</p>
<img src="https://s1.ax1x.com/2022/09/07/vH34Nq.png">

<h3 id="更换-hexo-主题"><a href="#更换-hexo-主题" class="headerlink" title="更换 hexo 主题"></a>更换 hexo 主题</h3><p>配置 MyBlog 文件夹主目录中的 _config.yml，打开 _config.yml ，将 theme 的默认值改为要更换的主题文件名。</p>
<img src="https://s1.ax1x.com/2022/09/07/vH8iKe.png">

<h3 id="安装-pug-以及-stylus-的渲染器"><a href="#安装-pug-以及-stylus-的渲染器" class="headerlink" title="安装 pug 以及 stylus 的渲染器"></a>安装 pug 以及 stylus 的渲染器</h3><p>npm install hexo-renderer-pug hexo-renderer-stylus –save</p>
<h3 id="重新运行新主题"><a href="#重新运行新主题" class="headerlink" title="重新运行新主题"></a>重新运行新主题</h3><p>hexo clean hexo g hexo s</p>
<p>在浏览器上输入 <a target="_blank" rel="noopener" href="http://localhost:4000/">http://localhost:4000</a> 查看主题效果</p>
<img src="https://s1.ax1x.com/2022/09/07/vH8bJP.png">

<h2 id="编辑文章"><a href="#编辑文章" class="headerlink" title="编辑文章"></a>编辑文章</h2><h3 id="文章开头模板"><a href="#文章开头模板" class="headerlink" title="文章开头模板"></a>文章开头模板</h3><p>在博客目录的 source 文件夹中的 _post 文件夹中添加你要写的博客文件，文件命名为 myblog.md</p>
<p>myblog.md 的文件开头如下:</p>
<p>具体编写方式需要查看对应主题的说明文档以及常用的 <a target="_blank" rel="noopener" href="https://www.runoob.com/markdown/md-tutorial.html">Markdown</a> 语法</p>
<img src="https://s1.ax1x.com/2022/09/07/vHGBSf.png">

<h3 id="重新运行查看效果"><a href="#重新运行查看效果" class="headerlink" title="重新运行查看效果"></a>重新运行查看效果</h3><p>hexo clean hexo g hexo s</p>
<img src="https://s1.ax1x.com/2022/09/07/vHGb79.png">

<h2 id="自动部署到-gitee"><a href="#自动部署到-gitee" class="headerlink" title="自动部署到 gitee"></a>自动部署到 gitee</h2><p>以上步骤已经可以让网站在本地服务器运行，但是本地服务器只有自己能查看，想要让更多人看到，可以通过 Gitee Pages 服务来进行自动化部署，这样网站就有了公开的网址了。</p>
<h3 id="新建仓库"><a href="#新建仓库" class="headerlink" title="新建仓库"></a>新建仓库</h3><p>gitee 官网：<a href="https://gitee.com/">https://gitee.com/</a></p>
<p>注意仓库名称和路径名称一致。</p>
<h3 id="修改配置文件"><a href="#修改配置文件" class="headerlink" title="修改配置文件"></a>修改配置文件</h3><p>配置 MyBlog 主目录中的 _config.yml，用记事本打开 _config.yml，根据你自己的仓库地址来修改配置文件，然后保存</p>
<p>url: 换成你的仓库地址</p>
<p>root: 需要新增一行，换成你的仓库名称</p>
<p>type: 改为 git</p>
<p>repo: 换成你的仓库 git 地址</p>
<p>branch: 改为 master</p>
<p>需要注意关键词后面都是英文冒号加一个空格</p>
<img src="https://s1.ax1x.com/2022/09/07/vHtwf1.png">

<img src="https://s1.ax1x.com/2022/09/07/vHJaB4.png">

<h3 id="安装部署工具"><a href="#安装部署工具" class="headerlink" title="安装部署工具"></a>安装部署工具</h3><p>npm install hexo-deployer-git –save</p>
<h3 id="绑定-gitee-账户信息"><a href="#绑定-gitee-账户信息" class="headerlink" title="绑定 gitee 账户信息"></a>绑定 gitee 账户信息</h3><p>git config –global user.email “换成自己的注册邮箱”<br>git config –global user.name “换成自己的注册用户名”</p>
<h3 id="部署-hexo"><a href="#部署-hexo" class="headerlink" title="部署 hexo"></a>部署 hexo</h3><p>hexo g –d 一键部署</p>
<p>第一次部署时会弹出一个对话框，输入 gitee 的账号密码即可。</p>
<h3 id="Gitee-Pages-手动更新"><a href="#Gitee-Pages-手动更新" class="headerlink" title="Gitee Pages 手动更新"></a>Gitee Pages 手动更新</h3><p>初次使用 Gitee Pages 部署页面时，需要身份证实名认证。</p>
<img src="https://s1.ax1x.com/2022/09/07/vHYSCq.png">

<img src="https://s1.ax1x.com/2022/09/07/vHt7nS.png">

<h3 id="访问-Gitee-Pages-网址"><a href="#访问-Gitee-Pages-网址" class="headerlink" title="访问 Gitee Pages 网址"></a>访问 Gitee Pages 网址</h3><img src="https://s1.ax1x.com/2022/09/07/vHtOts.png">

<h2 id="主题自定义配置（Butterfly）"><a href="#主题自定义配置（Butterfly）" class="headerlink" title="主题自定义配置（Butterfly）"></a>主题自定义配置（Butterfly）</h2><h3 id="官方安装文档"><a href="#官方安装文档" class="headerlink" title="官方安装文档"></a>官方安装文档</h3><p><a target="_blank" rel="noopener" href="https://butterfly.js.org/posts/21cfbf15/">Butterfly</a></p>
<img src="https://s1.ax1x.com/2022/09/07/vHtvpq.png">

<h3 id="配置文章封面"><a href="#配置文章封面" class="headerlink" title="配置文章封面"></a>配置文章封面</h3><img src="https://s1.ax1x.com/2022/09/07/vHNtjf.png">

<img src="https://s1.ax1x.com/2022/09/07/vHNcvV.png">

<img src="https://s1.ax1x.com/2022/09/07/vHNhE4.png">

<h3 id="更换网站的标题、作者、语言"><a href="#更换网站的标题、作者、语言" class="headerlink" title="更换网站的标题、作者、语言"></a>更换网站的标题、作者、语言</h3><img src="https://s1.ax1x.com/2022/09/07/vHU92t.png">

<h3 id="增加首页导航栏"><a href="#增加首页导航栏" class="headerlink" title="增加首页导航栏"></a>增加首页导航栏</h3><img src="https://s1.ax1x.com/2022/09/07/vHUGa4.png">

<p>在 themes 主题文件夹的_config.yml 内修改</p>
<img src="https://s1.ax1x.com/2022/09/07/vHapo4.png">

<img src="https://s3.bmp.ovh/imgs/2022/09/07/429a3a72459137bd.png">

<h3 id="侧边栏公告设置"><a href="#侧边栏公告设置" class="headerlink" title="侧边栏公告设置"></a>侧边栏公告设置</h3><p>网站侧边栏的公告区文本，对应的参数应该是 card_announcement，直接修改 content 关键词后面的内容即可</p>
<img src="https://s3.bmp.ovh/imgs/2022/09/07/579b451fc32df282.jpg">

<img src="https://s3.bmp.ovh/imgs/2022/09/07/27c130899817df73.jpg">

<img src="https://s3.bmp.ovh/imgs/2022/09/07/12bb21f2794dca01.jpg">

<h3 id="重新部署到-Gitee-Pages"><a href="#重新部署到-Gitee-Pages" class="headerlink" title="重新部署到 Gitee Pages"></a>重新部署到 Gitee Pages</h3><p>hexo clean</p>
<p>hexo g –d 一键部署</p>
<p>再去手动更新</p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="https://gitee.com/dmf-c/blog">dmf</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://gitee.com/dmf-c/blog/2021/11/28/MyBlog/">https://gitee.com/dmf-c/blog/2021/11/28/MyBlog/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://gitee.com/dmf-c/blog" target="_blank">dmf的个人博客</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="https://img1.baidu.com/it/u=3691791879,443411760&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=500&amp;h=889" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/blog/2021/12/18/mysql/"><img class="prev-cover" src="https://img1.baidu.com/it/u=3691791879,443411760&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=500&amp;h=889" onerror="onerror=null;src='/blog/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">mysql常用函数以及方法</div></div></a></div><div class="next-post pull-right"><a href="/blog/2021/11/13/js_file/GarbageCollection/"><img class="next-cover" src="https://img1.baidu.com/it/u=3691791879,443411760&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=500&amp;h=889" onerror="onerror=null;src='/blog/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">JavaScript中的垃圾回收和内存泄漏</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="this.onerror=null;this.src='/blog/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">dmf</div><div class="author-info__description"></div></div><div class="card-info-data site-data is-center"><a href="/blog/archives/"><div class="headline">文章</div><div class="length-num">27</div></a><a href="/blog/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/blog/categories/"><div class="headline">分类</div><div class="length-num">6</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">业精于勤，荒于嬉。</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%89%8D%E6%9C%9F%E5%87%86%E5%A4%87"><span class="toc-number">1.</span> <span class="toc-text">前期准备</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%BC%80%E5%A7%8B%E6%90%AD%E5%BB%BA"><span class="toc-number">2.</span> <span class="toc-text">开始搭建</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%96%B0%E5%BB%BA%E9%A1%B9%E7%9B%AE"><span class="toc-number">2.1.</span> <span class="toc-text">新建项目</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-hexo"><span class="toc-number">2.2.</span> <span class="toc-text">安装 hexo</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%BF%90%E8%A1%8C-hexo"><span class="toc-number">2.3.</span> <span class="toc-text">运行 hexo</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%BB%E9%A2%98%E7%BE%8E%E5%8C%96"><span class="toc-number">3.</span> <span class="toc-text">主题美化</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%80%89%E6%8B%A9%E4%B8%BB%E9%A2%98"><span class="toc-number">3.1.</span> <span class="toc-text">选择主题</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%BB%E9%A2%98%E4%B8%8B%E8%BD%BD"><span class="toc-number">3.2.</span> <span class="toc-text">主题下载</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%9B%B4%E6%8D%A2-hexo-%E4%B8%BB%E9%A2%98"><span class="toc-number">3.3.</span> <span class="toc-text">更换 hexo 主题</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-pug-%E4%BB%A5%E5%8F%8A-stylus-%E7%9A%84%E6%B8%B2%E6%9F%93%E5%99%A8"><span class="toc-number">3.4.</span> <span class="toc-text">安装 pug 以及 stylus 的渲染器</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%87%8D%E6%96%B0%E8%BF%90%E8%A1%8C%E6%96%B0%E4%B8%BB%E9%A2%98"><span class="toc-number">3.5.</span> <span class="toc-text">重新运行新主题</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%BC%96%E8%BE%91%E6%96%87%E7%AB%A0"><span class="toc-number">4.</span> <span class="toc-text">编辑文章</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E5%BC%80%E5%A4%B4%E6%A8%A1%E6%9D%BF"><span class="toc-number">4.1.</span> <span class="toc-text">文章开头模板</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%87%8D%E6%96%B0%E8%BF%90%E8%A1%8C%E6%9F%A5%E7%9C%8B%E6%95%88%E6%9E%9C"><span class="toc-number">4.2.</span> <span class="toc-text">重新运行查看效果</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%87%AA%E5%8A%A8%E9%83%A8%E7%BD%B2%E5%88%B0-gitee"><span class="toc-number">5.</span> <span class="toc-text">自动部署到 gitee</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%96%B0%E5%BB%BA%E4%BB%93%E5%BA%93"><span class="toc-number">5.1.</span> <span class="toc-text">新建仓库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"><span class="toc-number">5.2.</span> <span class="toc-text">修改配置文件</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2%E5%B7%A5%E5%85%B7"><span class="toc-number">5.3.</span> <span class="toc-text">安装部署工具</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%BB%91%E5%AE%9A-gitee-%E8%B4%A6%E6%88%B7%E4%BF%A1%E6%81%AF"><span class="toc-number">5.4.</span> <span class="toc-text">绑定 gitee 账户信息</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%83%A8%E7%BD%B2-hexo"><span class="toc-number">5.5.</span> <span class="toc-text">部署 hexo</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Gitee-Pages-%E6%89%8B%E5%8A%A8%E6%9B%B4%E6%96%B0"><span class="toc-number">5.6.</span> <span class="toc-text">Gitee Pages 手动更新</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%AE%BF%E9%97%AE-Gitee-Pages-%E7%BD%91%E5%9D%80"><span class="toc-number">5.7.</span> <span class="toc-text">访问 Gitee Pages 网址</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%BB%E9%A2%98%E8%87%AA%E5%AE%9A%E4%B9%89%E9%85%8D%E7%BD%AE%EF%BC%88Butterfly%EF%BC%89"><span class="toc-number">6.</span> <span class="toc-text">主题自定义配置（Butterfly）</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%98%E6%96%B9%E5%AE%89%E8%A3%85%E6%96%87%E6%A1%A3"><span class="toc-number">6.1.</span> <span class="toc-text">官方安装文档</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%85%8D%E7%BD%AE%E6%96%87%E7%AB%A0%E5%B0%81%E9%9D%A2"><span class="toc-number">6.2.</span> <span class="toc-text">配置文章封面</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%9B%B4%E6%8D%A2%E7%BD%91%E7%AB%99%E7%9A%84%E6%A0%87%E9%A2%98%E3%80%81%E4%BD%9C%E8%80%85%E3%80%81%E8%AF%AD%E8%A8%80"><span class="toc-number">6.3.</span> <span class="toc-text">更换网站的标题、作者、语言</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%A2%9E%E5%8A%A0%E9%A6%96%E9%A1%B5%E5%AF%BC%E8%88%AA%E6%A0%8F"><span class="toc-number">6.4.</span> <span class="toc-text">增加首页导航栏</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BE%A7%E8%BE%B9%E6%A0%8F%E5%85%AC%E5%91%8A%E8%AE%BE%E7%BD%AE"><span class="toc-number">6.5.</span> <span class="toc-text">侧边栏公告设置</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%87%8D%E6%96%B0%E9%83%A8%E7%BD%B2%E5%88%B0-Gitee-Pages"><span class="toc-number">6.6.</span> <span class="toc-text">重新部署到 Gitee Pages</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/blog/2023/01/08/vue_file/vuenote/" title="vue3入门笔记"><img src="https://img1.baidu.com/it/u=1828439677,2166285235&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=400&amp;h=300" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="vue3入门笔记"/></a><div class="content"><a class="title" href="/blog/2023/01/08/vue_file/vuenote/" title="vue3入门笔记">vue3入门笔记</a><time datetime="2023-01-07T16:00:00.000Z" title="发表于 2023-01-08 00:00:00">2023-01-08</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2022/02/20/vue_file/comm/" title="vue组件间通信六种方式"><img src="https://img1.baidu.com/it/u=1828439677,2166285235&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=400&amp;h=300" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="vue组件间通信六种方式"/></a><div class="content"><a class="title" href="/blog/2022/02/20/vue_file/comm/" title="vue组件间通信六种方式">vue组件间通信六种方式</a><time datetime="2022-02-19T16:00:00.000Z" title="发表于 2022-02-20 00:00:00">2022-02-20</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2022/02/05/wxEcharts/" title="微信小程序使用 echarts"><img src="https://img1.baidu.com/it/u=1828439677,2166285235&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=400&amp;h=300" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="微信小程序使用 echarts"/></a><div class="content"><a class="title" href="/blog/2022/02/05/wxEcharts/" title="微信小程序使用 echarts">微信小程序使用 echarts</a><time datetime="2022-02-04T16:00:00.000Z" title="发表于 2022-02-05 00:00:00">2022-02-05</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2022/01/30/vue_file/vue_router/" title="vue-router学习"><img src="https://img1.baidu.com/it/u=1828439677,2166285235&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=400&amp;h=300" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="vue-router学习"/></a><div class="content"><a class="title" href="/blog/2022/01/30/vue_file/vue_router/" title="vue-router学习">vue-router学习</a><time datetime="2022-01-29T16:00:00.000Z" title="发表于 2022-01-30 00:00:00">2022-01-30</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2022/01/16/vue_file/vuex/" title="Vuex使用方法"><img src="https://img1.baidu.com/it/u=1828439677,2166285235&amp;fm=253&amp;fmt=auto&amp;app=138&amp;f=JPEG?w=400&amp;h=300" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="Vuex使用方法"/></a><div class="content"><a class="title" href="/blog/2022/01/16/vue_file/vuex/" title="Vuex使用方法">Vuex使用方法</a><time datetime="2022-01-15T16:00:00.000Z" title="发表于 2022-01-16 00:00:00">2022-01-16</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By dmf</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/blog/js/utils.js"></script><script src="/blog/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>